package com.rd.student.ruanjian.class4.baiyunyao.DAY0728;

import java.io.*;

public class kaobei{
public static void copyFile1(File srcFile, File destFile) throws Exception {

    if (!destFile.exists()) {
        destFile.createNewFile();
    }

    InputStream is = new FileInputStream(srcFile);

    byte[] byteArr = new byte[(int) srcFile.length()];

    is.read(byteArr);


    OutputStream os = new FileOutputStream(destFile);

    os.write(byteArr);

    os.close();
    is.close();
}

}
